<!-- 客户评价模块 -->
<section id="testimonials" class="section-padding bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
    <div class="text-center max-w-3xl mx-auto mb-16">
    <span class="text-primary font-medium"><?= $data['content']['sectionBadge']?></span>
    <h2 class="section-title"><?= $data['content']['sectionTitle']?></h2>
    <p class="section-subtitle"><?= $data['content']['sectionSubtitle']?></p>
    </div>
    
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
    <?php foreach ($data['content']['testimonials'] as $testimonial): ?>
    <div class="bg-light p-8 rounded-xl card-hover">
        <div class="flex items-center mb-6">
        <img src="<?= $testimonial['author']['avatar'] ?>" alt="<?= $testimonial['author']['name'] ?>" class="w-14 h-14 rounded-full object-cover mr-4">
        <div>
            <h4 class="font-bold"><?= $testimonial['author']['name'] ?></h4>
            <p class="text-sm text-dark/60"><?= $testimonial['author']['position'] ?></p>
            <div class="flex text-yellow-400 mt-1">
            <?php for ($i = 1; $i <= 5; $i++): ?>
                <?php if ($i <= $testimonial['rating']): ?>
                <i class="fa fa-star"></i>
                <?php else: ?>
                <i class="fa fa-star-o"></i>
                <?php endif; ?>
            <?php endfor; ?>
            </div>
        </div>
        </div>
        <p class="text-dark/80 italic mb-4">
        "<?= $testimonial['content'] ?>"
        </p>
    </div>
    <?php endforeach; ?>
    </div>
    
    <!-- 满意度数据 -->
    <?php if (isset($data['content']['satisfactionData'])): ?>
    <div class="mt-20 bg-primary/5 rounded-2xl p-8 lg:p-12">
    <div class="flex flex-col lg:flex-row items-center">
        <div class="w-full lg:w-1/2 mb-10 lg:mb-0 lg:pr-10">
        <h3 class="text-2xl font-bold mb-4"><?= $data['content']['satisfactionData']['title'] ?></h3>
        <p class="text-dark/70 mb-6">
            <?= $data['content']['satisfactionData']['description'] ?>
        </p>
        <div class="space-y-4">
            <?php foreach ($data['content']['satisfactionData']['metrics'] as $metric): ?>
            <div>
            <div class="flex justify-between mb-1">
                <span class="font-medium"><?= $metric['name'] ?></span>
                <span class="text-primary font-bold"><?= $metric['value'] ?></span>
            </div>
            <div class="w-full bg-gray-200 rounded-full h-2">
                <div class="bg-primary h-2 rounded-full" style="width: <?= $metric['percentage'] ?>%"></div>
            </div>
            </div>
            <?php endforeach; ?>
        </div>
        </div>
        <?php if (isset($data['content']['showChart']) && $data['content']['showChart']): ?>
        <div class="w-full lg:w-1/2">
        <div class="bg-white p-4 rounded-xl shadow-md">
            <canvas id="resultsChart" width="400" height="300"></canvas>
        </div>
        </div>
        <?php endif; ?>
    </div>
    </div>
    <?php endif; ?>
</div>
</section>